package com.etc.utils;


import java.text.SimpleDateFormat;
import java.util.Date;

public class TimeUtils {
    public static String DateToStr(Date date) {

        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String str = format.format(date);
        return str;
    }


    public static void main(String[] args) {

        Date date = new Date();
        System.out.println("日期转字符串：" + TimeUtils.DateToStr(date));
    }

}
